/*! * (c) Copyright Adnami ApS, all rights reserved. * * Date: 2024-11-01T13:48:42.636Z * * Rest of the license is available at: https://macro.adnami.io/macro/gen/adsm.macro.rmb.js.LICENSE.txt */ (()=>{var e={249:function(e,t,n){var i;e.exports=(i=i||function(e,t){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==n.g&&n.g.crypto&&(i=n.g.crypto),!i)try{i=n(480)}catch(e){}var o=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},a=s.lib={},d=a.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=d.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,i=this.sigBytes,o=e.sigBytes;if(this.clamp(),i%4)for(var r=0;r>>2]>>>24-r%4*8&255;t[i+r>>>2]|=s<<24-(i+r)%4*8}else for(var a=0;a>>2]=n[a>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=d.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-o%4*8&255;i.push((r>>>4).toString(16)),i.push((15&r).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new c.init(n,t/2)}},h=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],o=0;o>>2]>>>24-o%4*8&255;i.push(String.fromCharCode(r))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new c.init(n,t)}},m=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},f=a.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=m.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,i=this._data,o=i.words,r=i.sigBytes,s=this.blockSize,a=r/(4*s),d=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,l=e.min(4*d,r);if(d){for(var u=0;u>>7)^(f<<14|f>>>18)^f>>>3,w=c[m-2],v=(w<<15|w>>>17)^(w<<13|w>>>19)^w>>>10;c[m]=p+c[m-7]+v+c[m-16]}var g=i&o^i&r^o&r,_=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&u)+d[m]+c[m];h=u,u=l,l=a,a=s+b|0,s=r,r=o,o=i,i=b+(_+g)|0}n[0]=n[0]+i|0,n[1]=n[1]+o|0,n[2]=n[2]+r|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+l|0,n[6]=n[6]+u|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,i=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(i/4294967296),n[15+(o+64>>>9<<4)]=i,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=r._createHelper(l),t.HmacSHA256=r._createHmacHelper(l)}(Math),i.SHA256)},480:()=>{}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=function(e,t){e&&e.postMessage&&e.postMessage(t,"*")};const t={id:function(){return"xxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}};let i=window.adsm=window.adsm||{},o={};const r={tracker:function(e,n){let r,s;if(i.sessionIds&&i.sessionIds[n]&&i.sessionIdTimes&&i.sessionIdTimes[n])r=i.sessionIds[n],s=i.sessionIdTimes[n];else{if(o[n])return;e="error_no_sid_or_sit",r=t.id(),s=Date.now(),o[n]=!0}const a="https://functions.adnami.io/api/tracker?ev="+e+"&cc="+n+"&cs="+encodeURIComponent(window.location.href.replace(window.location.search,""))+"&_="+Date.now()+"&sid="+r+"&sit="+s+"&mi="+window.adsm.macroId;if(navigator.sendBeacon)navigator.sendBeacon(a);else{(new Image).src=a}},tracker2:function(e,n,r){let s,a;if(i.sessionIds&&i.sessionIds[n]&&i.sessionIdTimes&&i.sessionIdTimes[n])s=i.sessionIds[n],a=i.sessionIdTimes[n];else{if(o[n])return;e="error_no_sid_or_sit",s=t.id(),a=Date.now(),o[n]=!0}const d="https://functions.adnami.io/api/tracker?ev="+e+"&cc="+n+"&cs="+encodeURIComponent(window.location.href.replace(window.location.search,""))+"&t="+r+"&_="+Date.now()+"&sid="+s+"&sit="+a+"&mi="+i.macroId;if(navigator.sendBeacon)navigator.sendBeacon(d);else{(new Image).src=d}}},s=function(){var t,n={midscroll_mobile:"midscroll_mobile",midscroll_desktop:"midscroll_desktop",midscroll_desktop_fullscreen:"midscroll_desktop_fullscreen",topscroll:"topscroll",skin:"skin",side_skin:"side_skin",inread_expander:"inread_expander",overlay:"overlay"},i={};function o(e){if(window.adsmtag&&window.adsmtag.macro&&window.adsmtag.macro.certifications){var t=window.adsmtag.macro.certifications,i=-1!=t.indexOf(e);return e!==n.midscroll_desktop_fullscreen&&e!=n.midscroll_desktop||(i=-1!=t.indexOf(n.midscroll_desktop)||-1!=t.indexOf(n.midscroll_desktop_fullscreen)),i}return!0}function s(n,i){t(i,(function(t){var i={type:n,payload:t};e(window.top,i),r.tracker("destroyed_format",t.uuid)}))}return i[n.midscroll_mobile]=["ADSM_RMB_HTML_INTERSCROLL_","ADSM_RMB_INTERSCROLL_"],i[n.midscroll_desktop]=["ADSM_RMB_INTERSCROLL_DESKTOP_","ADSM_RMB_FULLSCREEN_INTERSCROLL_DESKTOP_","ADSM_RMB_HTML_DESKTOP_INTERSCROLL_"],i[n.midscroll_desktop_fullscreen]=["ADSM_RMB_INTERSCROLL_DESKTOP_","ADSM_RMB_FULLSCREEN_INTERSCROLL_DESKTOP_","ADSM_RMB_HTML_DESKTOP_INTERSCROLL_"],i[n.topscroll]=["ADSM_RMB_HTML_TOPSCROLL_DESKTOP_","ADSM_RMB_TOPSCROLL_DESKTOP_"],i[n.skin]=["ADSM_RMB_SKIN_"],i[n.side_skin]=["ADSM_RMB_SIDESKIN_"],i[n.inread_expander]=["ADSM_RMB_EXPANDER_","ADSM_RMB_INREAD_"],i[n.overlay]=["ADSM_RMB_OVERLAY_"],{enable:function(e){t=e;var r="INIT",a="DESTROY";if(window.adsmtag&&window.adsmtag.macro&&window.adsmtag.macro.certifications){for(let e in n)for(var d=0;d{this._onAnyChange(e)}),"renderMode"),this._adnmObserver.onChanged((()=>{this._onAnyChange(e)}),"appName")}get(){const e=this._adnmObserver.get("renderMode"),t=this._adnmObserver.get("appName");if(this.dataIsValid(e,t))return t;throw Error("AppName cannot be retrieved. Verify appName or renderMode is defined and that they are strings.")}_onAnyChange(e){try{e(this.get())}catch(e){return}}dataIsValid(e,t){const n=!(!e||!t),i="string"==typeof e&&"string"==typeof t,o=e===g.BANNER;return n&&i&&o}};const b=function(e){const t=e||window;try{return t.top.document,!0}catch(e){return!1}};const E=/^(https?:\/\/)?([\w-]+\.)+[\w]{2,}(\/.*)?$/i;const y=["googlesyndication.com","safeframe.googlesyndication.com","connect.themediatrust.com","acdn.adnxs-simple.com","ib.adnxs.com","doubleclick.net","about:srcdoc","about:blank"];function I(e){return y.some((t=>e?.includes(t)))}const S=/^(https?:\/\/)?(?:((?:xn--)?[a-z0-9-]{0,61}[a-z0-9]\.)*(?:xn--)?[a-z0-9-]{1,61}\.[a-z]{2,})$/;function A(e){return S.test(e)}const C=function(e){let t=window.location.href.replace(window.location.search,"");const n=function(){try{return(new _).get()}catch(e){return""}}();if(n&&n.length>0)t=n;else if(b(window)&&window.top?.location?.href)t=window.top.location.href.replace(window.top.location.search,"");else if(window.location.ancestorOrigins?.length>0&&A(window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])){const e=window.location.ancestorOrigins;t=e[e.length-1]}else document.referrer&&A(document.referrer)&&(t=document.referrer);return e&&function(e){return E.test(e)}(e)&&I(t)&&(t=function(e,t){t.includes("doubleclick.net")||t.includes("googlesyndication.com")?t=e.replace(/^[\d.]+/,""):I(t)&&(t=e);return t}(e,t)),-1!==t.indexOf("://")||(t=`https://${t}`),encodeURIComponent(t)};const O=function(){try{const e=window.top?.document;return null!=e}catch(e){return!1}}();let T;O||function(){let e,t=window;const n={};for(;t;){try{if(t.frames.__tcfapiLocator){e=t;break}}catch(e){}if(t===window.top)break;t=t.parent}T=function(t,i,o,r){if(e){const s=Math.random()+"",a={__tcfapiCall:{command:t,parameter:r,version:i,callId:s}};n[s]=o,e.postMessage(a,"*")}else o({msg:"CMP not found"},!1)},window.addEventListener("message",(function(e){let t={};try{t="string"==typeof e.data?JSON.parse(e.data):e.data}catch(e){}const i=t.__tcfapiReturn;i&&"function"==typeof n[i.callId]&&(n[i.callId](i.returnValue,i.success),n[i.callId]=null)}),!1)}();const k=function(e,t,n,i){O&&window.top?.__tcfapi?window.top?.__tcfapi(e,t,n,i):T?T(e,t,n,i):n("Failed to retrieve consent",!1)};function R(e){const t=atob(e),n=t.length,i=new Uint8Array(new ArrayBuffer(n));for(let e=0;et.errorCode===e.errorCode&&t.errorMessage===e.errorMessage));t?t.occurrence=(t.occurrence??1)+1:(e.occurrence=e.occurrence??1,i.errors.push(e))},logErrors:function(){if(i.errors&&i.errors.length>0){const e=JSON.stringify(i);navigator.sendBeacon("https://functions.adnami.io/api/debug",e),i.errors.length=0}}}};(window.adsmtag=window.adsmtag||{}).rmb=window.adsmtag.rmb=window.adsmtag.rmb||{};const L=class{placeholderName="default";adParameters={click:"",uid:"",aid:"",gdpr:"",gdpr_c:"",addtl_c:"",cb:"",sid:"",sit:"",cs:""};tcfData={tcfAccessible:!1,gdprApplies:"",tcString:"",addtlConsent:""};adLoaded={};constructor(e,t,n){this.frame=n,window.__adnamiAdsAPI&&window.__adnamiAdsAPIFactory?(this.adnamiAdsAPIFactory=window.__adnamiAdsAPIFactory,this.adnamiAdsApi=window.__adnamiAdsAPI):window.__adnamiAdsAPI?(this.adnamiAdsAPIFactory=void 0,this.adnamiAdsApi=window.__adnamiAdsAPI):this.adnamiAdsAPIFactory=e,this.adunit=t.frame,this.formatType=t.formatType,this.creativeCode=t.uuid,this.readAndStorePayload(t),this.frame.setAttribute("data-adnm-forward","")}loadAd(){this.createCallback(),this.validDataReceived(this.adParameters.gdpr,this.adParameters.gdpr_c)?this.executeCallback():k&&void 0!==k&&k("addEventListener",2,this.getGdprValuesAndExecuteCallback.bind(this),void 0)}readAndStorePayload(e){const t=this.getCreativeSiteOrigin(e?.sourceUrl);if(this.adParameters={click:encodeURIComponent(e.ad.click),uid:e.ad.uid||"",aid:e.ad.aid||"",gdpr:this.removePrefix(e.ad.gdpr)||"",gdpr_c:this.removePrefix(e.ad.gdpr_c)||"",addtl_c:this.removePrefix(e.ad.addtl_c)||"",cb:"adsmtag.rmb.callback_"+e.id,sid:e.id,sit:e.sit,cs:t},e.ad?.custom)for(const t in e.ad.custom)this.adParameters[t]=e.ad.custom[t]}validatePlacement(e){const t=window.adsm?.certifications?.[e]?.cert,n=t?.allowedPlacements;if(void 0!==n){const e=this.adunit??this.frame;if(!function(e,t){let n=0;for(const i of t){const t=document.querySelector(i);if(!t){n++;continue}let o=e.parentElement;for(;o&&"BODY"!==o.tagName;){if(o===t)return!0;o=o.parentElement}}return n===t.length}(e,n))return this.adnamiAdsApi?.v1.tracker.trackEvent("incorrect_placement"),e.style.display="none",!1}return!0}validateSize(e){const t=window.adsm?.certifications?.[e]?.cert,n=t?.allowedSizes;if(void 0!==n&&this.adunit){if(!function(e,t){const n=parseInt(e.getAttribute("width")??"0"),i=parseInt(e.getAttribute("height")??"0"),o=e.getBoundingClientRect(),r=0!==n?n:o.width,s=0!==i?i:o.height;return t.some((e=>e.width===r&&e.height===s))}(this.adunit,n))return this.adnamiAdsApi?.v1.tracker.trackEvent("incorrect_size"),this.adunit.style.display="none",!1}else void 0!==n&&this.adnamiAdsApi?.v1.tracker.trackEvent("size_adunit_missing");return!0}createAdnamiAdsAPI(e){e?.creativeCode&&this.adnamiAdsAPIFactory&&this.adnamiAdsAPIFactory.setCreativeCode(e.creativeCode),!this.adnamiAdsApi&&this.adnamiAdsAPIFactory&&(this.adnamiAdsApi=this.adnamiAdsAPIFactory.create(this.placeholderName))}createCallback(){let e=!1;window.adsmtag.rmb["callback_"+this.adParameters.sid]=t=>{if(e)return;e=!0,this.createAdnamiAdsAPI(t),"canvas"!==this.formatType&&"canvasmobile"!==this.formatType||!this.adnamiAdsApi||(this.adunit?this.adnamiAdsApi.v1.tracker.trackAdunitViewabilityElement(this.adunit):this.adnamiAdsApi.v1.tracker.trackError("adunit_iframe_not_found"));const n=t.html.match(/getCert\("([^"]+)"\)/)?.[1];if(!this.validatePlacement(n))return;if(!this.validateSize(n))return;this.enableAdsApi(this.frame);const i=!window.__adnamiAdsAPI;"banner"===this.formatType&&i&&this.adnamiAdsApi?.v1?.tracker?.trackViewabilityElement(this.frame);const o=this.frame.contentWindow?.document??this.frame.contentDocument;o?.open("text/html","replace"),o?.write(t.html),o?.close()}}validDataReceived(e,t){return 0===e||"0"===e||(1===e||"1"===e)&&this.isNotEmptyOrDefaultString(t)}isNotEmptyOrDefaultString(e){return"string"==typeof e&&e.length>0&&!this.defaultValueDetected(e)}defaultValueDetected(e){const t=["${GDPR}","${GDPR_CONSENT_612}","${ADDTL_CONSENT}","<%%GDPR_APPLIES%%>","<%%GDPR_CONSENT%%>","[sas_gdpr_applies]","[sas_gdpr_consent]","[sas_addtl_consent]"];for(const n of t)if(-1!==e.indexOf(n))return!0}executeCallback(){const e=this.adParameters;if(void 0!==this.adLoaded[e.cb]&&!0===this.adLoaded[e.cb])return;this.adLoaded[e.cb]=!0,e.click=this.replaceConsentStringWithMacro(e.click);const t=`https://directive.adnami.io/adsm.rmb.${this.creativeCode}?`,n=[];for(const t in e)e.hasOwnProperty(t)&&n.push(t+"="+e[t]);this.appendScriptWithDirectiveSource(t,n)}appendScriptWithDirectiveSource(e,t){let n=this.createQueryString(t);const i=n.length>0;let o=!1;const r=()=>{o||(o=!0,n.length>7500&&(n=n.replace(this.adParameters.addtl_c,"")),this.loadScript(e+n))};if(window.Promise&&i){D.compress(n).catch((()=>{r()})).then((t=>{const i=t!==btoa("[object ReadableStream]");if(!i){const e=x();e.addError({errorCode:"Compressesion Failed",errorMessage:'CompressedQueryString is [object ReadableStream] with following query:"'+n+'"',_:Date.now()}),e.logErrors()}i&&"string"==typeof t&&t.length>0?this.loadScript(e+"cmp=1&req="+t,r):r()}))}else r()}loadScript(e,t){const n=document.createElement("script");n.type="text/javascript",t&&(n.onerror=()=>{t()}),n.src=e,window.document.body.appendChild(n)}createQueryString(e){return e.join(";")}replaceConsentStringWithMacro(e){return this.adParameters.gdpr_c&&0!==this.adParameters.gdpr_c.length?this.adParameters.click.split(this.adParameters.gdpr_c).join(encodeURIComponent("${GDPR_CONSENT_612}")):e}getGdprValuesAndExecuteCallback(e,t){t?(this.tcfData.tcfAccessible=!0,this.tcfData.gdprApplies=e.gdprApplies?1:0,this.tcfData.tcString=e.tcString,this.tcfData.addtlConsent=e.addtlConsent,this.prepareData(this.tcfData),this.executeCallback()):(this.prepareData(this.tcfData),this.executeCallback())}prepareData(e){this.adParameters.gdpr=e.gdprApplies||"",this.adParameters.gdpr_c=e.tcString||"",this.adParameters.addtl_c=e.addtlConsent||""}getCreativeSiteOrigin(e){try{const t=C(e);return encodeURIComponent(new URL(decodeURIComponent(t)).origin)}catch(t){return C(e)}}removePrefix(e){const t=["gdpr=","gdpr_consent=","addtl_consent="];for(const n of t)"string"==typeof e&&(e=e.replace(n,""));return e}enableAdsApi(e){e?.contentWindow&&(e.contentWindow.__adnamiAdsAPI=this.adnamiAdsApi,e.contentWindow.__adnamiAdsAPIFactory=this.adnamiAdsAPIFactory)}};const M=function(e){if(!e)return;return function(e){const t=e.bottom-e.height/20?-1*e:e}}(e.getBoundingClientRect())};var N=n(153),P=n.n(N),B=n(465),V=n.n(B);const W=function(e){return P()(e).toString(V())};function U(e,t){const n=W(e),i=n.slice(0,n.length/2);return-1!==t.indexOf(i)}const H=["11e5a9827f44bf3f4a2e1b3b458e99de","63f4ec1994ff446fe0ea0d07c6655c93","74a44220fabc78390bdc1bfaeb370f93","cec323288ea92c0d2fae3d85ecd87b37","950df697b1dffbf89e6b164916f3ed1d","1e281f0d2332e3405674b22d7c790d8d"];let F=function(e){return e.AUTO="AUTO",e.IMAGE="IMAGE",e.BEACON="BEACON",e}({});function $(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F.AUTO;if(t===F.AUTO)return void 0!==navigator.sendBeacon?$(e,F.BEACON):$(e,F.IMAGE);if(t===F.BEACON)navigator.sendBeacon(e);else{(new Image).src=e}}const j={videoimpression:"impression",videostart:"start",videofirstquartile:"firstQuartile",videomidpoint:"midpoint",videothirdquartile:"thirdQuartile",videocomplete:"complete"};function z(e){return["videoimpression","videostart","videofirstquartile","videomidpoint","videothirdquartile","videocomplete"].includes(e.toLowerCase())}const q=function(e,t){const n=t,i=function(e){if(!e||0===e.length)return;let t={};return t=e.reduce(((e,t)=>{const n=j[t.type.toLowerCase()];return n&&(e[n]=t.src),e}),t),t}(n.ownerDocument?.defaultView?.__adnamiAdsAPI?.v1?.ThirdPartyTrackers);a(i?.impression),function(e){try{e.hasAttribute("loop")&&e.removeAttribute("loop"),e.hasAttribute("autoplay")&&e.removeAttribute("autoplay")}catch(e){}}(n),function(){const e=function(){o.started&&o.timesLooped<1?(r(ue.VIDEO_COMPLETE,.25*n.duration*1e3),o.timesLooped++,o.started=!1,a(i?.complete)):o.started&&(r(ue.VIDEO_COMPLETE,1e3*n.duration),o.timesLooped++,o.started=!1,a(i?.complete))};n.addEventListener("ended",e),n.addEventListener("adnm_ended",e)}(),function(){const e=[!1,!1,!1];let t=!1;n.addEventListener("timeupdate",(function(){const o=.25*n.duration*1e3;n.duration>0&&!t&&(r(ue.VIDEO_START),t=!0,a(i?.start)),s(.25*n.duration)<=s(n.currentTime)&&!e[0]&&(r(ue.VIDEO_FIRST_QUARTILE,o),e[0]=!0,a(i?.firstQuartile)),s(.5*n.duration)<=s(n.currentTime)&&!e[1]&&(r(ue.VIDEO_MIDPOINT,o),e[1]=!0,a(i?.midpoint)),s(.75*n.duration)<=s(n.currentTime)&&!e[2]&&(r(ue.VIDEO_THIRD_QUARTILE,o),e[2]=!0,a(i?.thirdQuartile))}))}(),n.addEventListener("timeupdate",(function(){n.currentTime>0&&!o.started&&!n.paused&&(o.started=!0)}));const o={timesLooped:0,started:!1},r=e;function s(e){return Math.round(100*e)/100}function a(e){e&&$(e,F.IMAGE)}};class G{isFinished=!1;timeElapsed=0;timeOffset=0;nativeTimeout=null;constructor(e,t){this.callback=e,this.duration=t}resume(){this.isFinished||this.nativeTimeout||(this.timeOffset=window.performance.now(),this.nativeTimeout=setTimeout((()=>{this.isFinished=!0,this.callback()}),this.duration-this.timeElapsed))}pause(){!this.isFinished&&this.nativeTimeout&&(clearTimeout(this.nativeTimeout),this.nativeTimeout=null,this.timeElapsed=window.performance.now()-this.timeOffset)}}function K(e,t){const n=function(e){const t=e.getBoundingClientRect(),n={top:Math.max(t.top,0),left:Math.max(t.left,0),bottom:Math.min(t.bottom,window.innerHeight),right:Math.min(t.right,window.innerWidth)};return n.width=n.right-n.left,n.height=n.bottom-n.top,n}(e),i=Number(n.right-n.left),o=Number(n.bottom-n.top);if(isNaN(i)||isNaN(o)||i<=0||o<=0)return 0;const r=Number(i/t);let s=0;for(let t=0;t{let e=0;t?.visibleRatioDetection&&(e=K(this.observedElement,20)),this.callback(Y.VIEWED_SECOND,{elapsed:window.performance.now(),visibleRatio:e})}),1e3)}observe(e){if(this.isObserving)throw new Error("ViewabilityObserver instance is already observing");this.observedElement=e,this.isObserving=!0,this.intersectionObserver.observe(e),this.isDocumentVisible="visible"===document.visibilityState,window.document.addEventListener("visibilitychange",(()=>{const e=window.performance.now(),t=e-this.timeOffset;"visible"===document.visibilityState?(this.isDocumentVisible=!0,this.isTargetInView&&(this.timeOffset=e,this.viewedOneSecondTimeout.resume(),this.callback(Y.ENTER_FOCUS,{elapsed:t}))):"hidden"===document.visibilityState&&(this.isDocumentVisible=!1,this.isTargetInView&&(this.timeOffset=e,this.viewedOneSecondTimeout.pause(),this.callback(Y.EXIT_FOCUS,{elapsed:t})))}))}intersectionObserverCallback(e){if(0===e.length)return;const t=e[0];if(t.isIntersecting&&!this.isTargetInView){if(this.isTargetInView=!0,this.isDocumentVisible){const e=t.time-this.timeOffset;this.timeOffset=t.time,this.viewedOneSecondTimeout.resume(),this.callback(Y.ENTER_SCROLL,{elapsed:e})}}else if(!t.isIntersecting&&this.isTargetInView&&(this.isTargetInView=!1,this.isDocumentVisible)){const e=t.time-this.timeOffset;this.timeOffset=t.time,this.viewedOneSecondTimeout.pause(),this.callback(Y.EXIT_SCROLL,{elapsed:e})}}}let Y=function(e){return e[e.VIEWED_SECOND=0]="VIEWED_SECOND",e[e.ENTER_SCROLL=1]="ENTER_SCROLL",e[e.EXIT_SCROLL=2]="EXIT_SCROLL",e[e.EXIT_FOCUS=3]="EXIT_FOCUS",e[e.ENTER_FOCUS=4]="ENTER_FOCUS",e}({});class J{isObserving=!1;hasLeftView=!0;timeOffset=0;constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.mraid=t,this.callback=e,this.threshold=100*n,this.viewedOneSecondTimeout=new G((()=>{this.callback(Y.VIEWED_SECOND,{elapsed:window.performance.now()})}),1e3)}observe(e){if(this.isObserving)throw new Error("ViewabilityObserver instance is already observing");this.isObserving=!0,this.mraid.addEventListener("exposureChange",(t=>{if(void 0===t?.exposedPercentage)return;const n=window.performance.now(),i=n-this.timeOffset,o=e.isConnected&&t.exposedPercentage>=this.threshold;o&&this.hasLeftView?(this.timeOffset=n,this.viewedOneSecondTimeout.resume(),this.hasLeftView=!1,this.callback(Y.ENTER_SCROLL,{elapsed:i})):o||this.hasLeftView||(this.timeOffset=n,this.viewedOneSecondTimeout.pause(),this.hasLeftView=!0,this.callback(Y.EXIT_SCROLL,{elapsed:i}))}))}}let Q=function(e){return e.Banner="b",e.Canvas="c",e.CanvasMobile="cm",e}({}),Z=function(e){return e.Unknown="u",e.Small="s",e.Large="l",e}({});const ee=function(){const e=navigator.userAgent;return e&&/android|blackberry|iphone|ipad|ipod|opera mini|palm|windows (phone|ce)|iemobile|mobile|tablet/i.test(e.toLowerCase())?"Mobile":e&&""!==e?"Desktop":window.screen?.width<1024?"Mobile":window.screen?.width>=1024?"Desktop":"Unknown"};function te(e,t,n){const i=t===Z.Small||n?.5:.3;return!n&&window.screen?.height&&e>window.screen.height?i*window.screen.height/e:i}function ne(e,t){const n=ee(),i=e*t;return 0===i?Z.Large:"Desktop"===n?i>=242500?Z.Large:Z.Small:"Mobile"===n?i>=153600?Z.Large:Z.Small:Z.Unknown}const ie=class{executeOnSet={};stateCallbacks={};stateInfo={};executeCallbacks(e){for(const t of this.stateCallbacks[String(e)])t(this.stateInfo[String(e)])}updateStateInfo(e,t){!!this.stateInfo[t]&&this.executeOnSet[t]||(this.stateInfo[t]=e)}removeCallback(e,t){-1!==this.stateCallbacks[String(e)].indexOf(t)&&this.stateCallbacks[String(e)].splice(this.stateCallbacks[String(e)].indexOf(t),1)}onSet(e,t){this.stateCallbacks[String(e)]=this.stateCallbacks[String(e)]||[],this.stateCallbacks[String(e)].push(t),!0===this.executeOnSet[String(e)]&&t(this.stateInfo[String(e)])}set(e,t,n){void 0!==n&&this.updateStateInfo(n,String(e)),this.stateCallbacks[String(e)]=this.stateCallbacks[String(e)]||[],this.executeOnSet[String(e)]=!t,this.executeCallbacks(e)}};const oe=function(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:80,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50;return new Promise(((o,r)=>{let s=0;const a=e();null!=a?o(a):t=setInterval((()=>{const a=e();null!=a?(clearInterval(t),o(a)):s>=n&&(clearInterval(t),r(new Error(`[WaitFor.ts] That did not return a defined value within '${n*i}' ms`))),s++}),i)}))};const re=class{mraidEventHandler=new ie;mraid=window.mraid||window.frameElement&&window.parent.mraid;constructor(){this.enableMRAID()}enableMRAID(){const e=document.createElement("script");e.src="mraid.js",document.head.appendChild(e),oe((()=>window.mraid||window.frameElement&&window.parent.mraid)).then((e=>{this.mraid=e;"loading"===e.getState()?this.addMraidEventListeners("ready",this.onMRAIDReady.bind(this)):this.onMRAIDReady()}))}onMRAIDReady(){this.mraidEventHandler.set("ready",!1),this.addMraidEventListeners("viewableChange",(e=>{this.mraidEventHandler.set("viewableChange",!0,e)})),this.mraidEventHandler.set("viewableChange",!0,this.mraid.isViewable()),this.addMraidEventListeners("exposureChange",((e,t,n)=>{this.mraidEventHandler.set("exposureChange",!0,{exposedPercentage:e,visibleRectangle:t,occlusionRectangle:n})}))}addMraidEventListeners(e,t){this.mraid.addEventListener(e,t)}addEventListener(e,t){this.mraidEventHandler.onSet(e,t)}removeEventListener(e,t){this.mraidEventHandler.removeCallback(e,t)}static IsMraidAvailable(e){const t=window.location.href,n=!0===window.MRAID_ENV?.adnmTest,i=-1!==t.indexOf("mraid")&&-1!==t.indexOf("doubleclick.net"),o=-1!==e.indexOf("adsenseformobileapps.com"),r=typeof window.MRAID_ENV==typeof{};return o||i||r||n}};class se{counter=0;constructor(e,t){this.track=e,this.apiConfig=t}formatViewability(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(!e)return;e.classList.add("adnm-generic-"+this.counter),this.counter++;const i=e.getBoundingClientRect(),o=ne(i.width,i.height),r=te(i.height,o,t);if(re.IsMraidAvailable(this.apiConfig?.sourceUrl||"")){new J(this.getFormatViewabilityObserverCallback(e,n,o),new re,r).observe(e)}else if(t){this.trackAdunitId(e);new X(this.getAdunitViewabilityObserverCallback(e),{threshold:r}).observe(e)}else{new X(this.getFormatViewabilityObserverCallback(e,n,o),{threshold:r,visibleRatioDetection:!0}).observe(e)}}getAdunitViewabilityObserverCallback(e){return t=>{if(t===Y.VIEWED_SECOND){const t=e.getBoundingClientRect();t.width*t.height>900?this.track(ue.ADUNIT_IMP_VIEWED):this.track(ue.ERROR_ADUNIT_SIZE)}}}getFormatViewabilityObserverCallback(e,t,n){return(i,o)=>{if(i===Y.ENTER_SCROLL)this.track("wrapper_inview");else if(i===Y.EXIT_SCROLL)this.track("wrapper_leave_view",{time:o.elapsed});else if(i===Y.ENTER_FOCUS)this.track("wrapper_page_inview");else if(i===Y.EXIT_FOCUS)this.track("wrapper_page_leave_view",{time:o.elapsed});else if(i===Y.VIEWED_SECOND){const i=e.getBoundingClientRect();this.track("wrapper_imp_viewed",{size:n,device:this.parseFormatType(t),adWidth:Number(i.width),adHeight:Number(i.height),windowWidth:window.screen?.width??0,windowHeight:window.screen?.height??0,format:this.apiConfig?.format});if(100*Math.random()>=99){const e=x(this.apiConfig);e.addError({errorCode:"format_visibility_ratio",errorMessage:`F: ${this.apiConfig?.format}, V: ${o.visibleRatio}`,_:Date.now()}),e.logErrors()}}}}trackAdunitId(e){const t=e.id;if(t.includes("google_ads_iframe")){const e=t.split("/");this.track(ue.ADUNIT_ID,{adunitId:e[e.length-1]})}else this.track(ue.ADUNIT_ID,{adunitId:"unknown"})}parseFormatType=e=>"string"!=typeof e?null:{canvasmobile:"cm",canvas:"c",banner:"b"}[e]||null}const ae=function(e,t){const n=new se(e,t);return{formatViewability:n.formatViewability.bind(n)}};const de=function(e,t){const n=window===window.top;let i,o={isEmpty:!0},r=!1;function s(e,n){const r=function(e,t){if(window.adsmtag&&window.adsmtag.rmb){const n="function"==typeof window.adsmtag.rmb["callback_"+e],i=null!==document.body.querySelector('iframe[id$="'+e+'"]'),r=!o[t]||-1===o[t].sessionId.indexOf(e);return n&&i&&r}return!1}(n,void 0),s=function(e){return!(-1!==e.indexOf("midscroll")||-1!==e.indexOf("interscroll"))}(e);r&&s&&(o[e]=o[e]||{},o[e].sessions=o[e].sessions||[],o[e].sessions.push(n),o.isEmpty=!1,n===t&&(i=e))}n&&function(){const e=document.querySelector("html");for(let t=0;t1),r&&e(ue.ERROR_DOUBLE_LOAD_API)};const ce=class{_remainingIframeLimit=10;_trackedIframes=[];constructor(e,t){this._trackEvent=t,this._sessionId=e}enableOnClick(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=e?.ownerDocument.querySelectorAll('iframe[id$="'+this._sessionId+'"]');if(-1!==e?.classList[0]?.indexOf("adsm")||-1!==e?.classList[0]?.indexOf("adnm")){const t=e.querySelectorAll("iframe");this.setupClickEventListenerOnContainingIframes(t)}this.setupClickEventListenerOnContainingIframes(n),t&&setTimeout((()=>{this.enableOnClick(e,!1)}),500)}setupClickEventListenerOnContainingIframes(e){for(const t of e)t&&this._remainingIframeLimit>0&&this.canAccessIframe(t)&&!this.isIframeAlreadyTracked(t)&&(this._trackedIframes.push(t),this._remainingIframeLimit--,t.contentWindow?setTimeout((()=>{this.trackIframe(t)}),0):t.addEventListener("load",(()=>this.trackIframe(t))))}trackIframe(e){if(e.contentWindow){const t=e.contentWindow.document.querySelectorAll("iframe");t.length>0&&this.setupClickEventListenerOnContainingIframes(t),e.contentWindow.addEventListener("click",(()=>this._trackEvent(ue.CLICK)),!0)}}isIframeAlreadyTracked(e){return this._trackedIframes.some((t=>t===e))}canAccessIframe(e){return!(e.hasAttribute("sandbox")&&!e.getAttribute("sandbox")?.includes("allow-same-origin"))&&!("about:blank"!==e.src&&""!==e.src&&!e.src.startsWith("javascript"))}},le=function(e,n,i,o,r){const s=e.creativeCode,a=e.sessionId||t.id(),d=e.sessionTimeId||Date.now(),c=e.formatType??"",l=ae(g,e),u=new ce(a,p);let h=C(e.sourceUrl);(new _).onChange((()=>{h=C(e.sourceUrl),p(ue.RERENDERED)}));const m={pageLoadedTime:0,distanceToAd:void 0,tracked:!1},f=x(e);if(-1!==h.indexOf("example.com")){const t=window.document.head.querySelector("title")?.innerHTML??"Title could not be retrieved";let n=document.body.innerHTML;n.length>1e3&&(n=n.slice(0,1e3));let i=document.head.innerHTML;i.length>1e3&&(i=i.slice(0,1e3));E("unexpected_site",`Title: '${t}' | isWindowTop: '${window===window.top}' | Number of ancestor origins: '${window.location.ancestorOrigins.length}'| Body: '${n}' | Head: '${i}' | URL: '${window.location.href}' | Source URL: '${e.sourceUrl}'`)}function p(e){g(e)}function w(e){p("error_"+e)}function v(e,t){g(e,{time:t})}function g(e,t){const n=function(e){return`https://functions.adnami.io/api/tracker?ev=${e}&cc=${s}&cs=${h}&_=${Date.now()}&sid=${a}&sit=${d}`}(e)+`${t?function(e){let{time:t,windowWidth:n,windowHeight:i,adWidth:o,adHeight:r,distance:s,adunitId:a,device:d,size:c}=e;return(t?`&t=${t}`:"")+(n?`&ww=${n}`:"")+(i?`&wh=${i}`:"")+(o?`&aw=${o}`:"")+(r?`&ah=${r}`:"")+(s?`&dist=${s}`:"")+(a?`&aid=${a}`:"")+(d?`&dev=${d}`:"")+(c?`&sz=${c}`:"")}(t):""}`;var i;i=n,navigator.sendBeacon?navigator.sendBeacon(i):(new window.Image).src=i,r&&function(e,t,n){const i=Date.now();"click"===t||t.startsWith("interaction")||"wrapper_inview"===t||"wrapper_page_inview"===t?e.trackEvent(t,i):"wrapper_leave_view"===t||"wrapper_page_leave_view"===t?e.trackEvent(t,i,n):"wrapper_imp_viewed"===t&&e.trackEvent(t,i,{size:n?.size,device:n?.device,width:Math.round(n?.adWidth),height:Math.round(n?.adHeight),windowWidth:Number(n?.windowWidth),windowHeight:Number(n?.windowHeight),format:n?.format})}(r,e,t)}function E(e,t){f.addError({errorCode:e,errorMessage:t,_:Date.now()}),f.logErrors()}function y(){de(w,a)}return e.sourceUrl&&(h.includes("doubleclick")||h.includes("r.inmobi.com")||h.includes("c.amazon-adsystem.com")||h.includes("googlesyndication")||h.includes("adnxs")||h.includes("themediatrust")||h.includes("googleusercontent")||h.includes("googleadservices")||h.includes("acdn.adnxs-simple.com"))&&E("source_macro",`source:${e.sourceUrl}, click:${e.clickUrl}`),o.isSubscribed("trackWithDetails")||o.subscribe("trackWithDetails",(e=>g(e))),o.isSubscribed("trackTime")||o.subscribe("trackTime",(e=>v(e.event,e.time))),{trackEvent:p,trackTimeEvent:v,trackViewabilityElement:function(t,n){let o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(n?.length>0)try{!function(e,t){for(const n of t)if(n.type&&n.src&&"iframe"===n.type){const t=document.createElement("iframe");t.src=n.src,t.style.zIndex="-1",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.style.visibility="hidden",t.style.opacity="0",t.style.display="block",t.style.position="absolute",e.appendChild(t)}else if(n.type&&n.src&&"script"===n.type){const t=document.createElement("script");t.type="text/javascript",t.src=n.src,e.appendChild(t)}else z(n.type)}(t,n)}catch(e){}o||l.formatViewability(t,!1,c),u.enableOnClick(t),m.distanceToAd=M(t),t&&(t.setAttribute("data-adnm-vt",""),t.setAttribute("data-adnm-cc",s),t.setAttribute("data-adnm-sid",a),e.format&&t.setAttribute("data-adnm-fid",e.format)),i.set("canvasMeasurable",{viewablityElement:t})},trackAdunitViewabilityElement:function(e){l.formatViewability(e,!0)},trackVideoElement:function(e){i.set("bannerVideoMeasurable",{videoElement:e}),q(v,e)},trackExit:function(){p(ue.EXIT)},trackInit:function(){p(ue.INIT)},trackError:w,trackLoaded:function(){p(ue.LOADED),y(),b(window)&&function(e,t){0===e.indexOf("www")&&(e=e.slice(4));let n=U(e,t);if(n||(n=U(`*.${e}`,t)),!n){const i=e.split(".");i[0]="*",n=U(i.join("."),t)}return n}(function(){const e=document.createElement("a");return window.location&&window.location.ancestorOrigins&&window.location.ancestorOrigins.length>0?e.href=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1]:e.href=document.referrer,e.hostname||e.host}(),H)&&function(){const e=window.top?.performance?.now(),t=window.top?.performance?.getEntriesByType("navigation");if(!e||!t||0==t?.length)return;const n=t[0].domInteractive;if(!n)return;const i=Math.ceil(e-n);m.pageLoadedTime=i,document.addEventListener("visibilitychange",(()=>{var e,t,n;m.tracked||(m.tracked=!0,e=ue.PAGE_LOAD_TIME,t=m.pageLoadedTime,n=m.distanceToAd,g(e,{time:t,distance:n}))}))}()},trackIfDoubleLoad:y,trackDebugMessage:E,sessionId:a}};let ue=function(e){return e.PRE_IMP="pre_imp",e.INIT="init",e.EXIT="exit",e.CLICK="click",e.RERENDERED="rerendered",e.UPGRADED="upgraded",e.LOADED="loaded",e.PAGE_LOAD_TIME="page_load_time",e.DESTROYED_FORMAT="destroyed_format",e.BANNER_INJECTED="banner_injected",e.BANNER_LOADED="banner_loaded",e.WRAPPER_IMP_VIEWED="wrapper_imp_viewed",e.WRAPPER_INVIEW="wrapper_inview",e.WRAPPER_LEAVE_VIEW="wrapper_leave_view",e.WRAPPER_PAGE_INVIEW="wrapper_page_inview",e.WRAPPER_PAGE_LEAVE_VIEW="wrapper_page_leave_view",e.ADUNIT_ID="adunit_id",e.ADUNIT_IMP_VIEWED="adunit_imp_viewed",e.VIDEO_START="video_start",e.VIDEO_FIRST_QUARTILE="video_firstQuartile",e.VIDEO_MIDPOINT="video_midpoint",e.VIDEO_THIRD_QUARTILE="video_thirdQuartile",e.VIDEO_COMPLETE="video_complete",e.ERROR_PREFIX="error_",e.ERROR_ADUNIT_SIZE="error_adunit_size",e.ERROR_INVALID_API_CONFIG="invalidApiConfig",e.ERROR_DOUBLE_LOAD_API="double_load_api",e.ERROR_GET_CERT="getCert",e.ERROR_NO_SID_OR_SIT="error_no_sid_or_sit",e}({});const he=function(e,t,n){let i,o;(!n||"string"!=typeof n||parseInt(n)>100)&&(n="10%");let r=1;const s=5;let a=!1;const d=n,c=t;let l=e;function u(e){e?o=e:l.frameElement?o=function(){const e=l;let t,n=l;for(;n.parent!==window.top;)try{n.parent.document&&(n=n.parent)}catch(e){break}for(t=n.frameElement?n.frameElement:e.frameElement;n.frameElement&&t.parentNode!==window.top.document.body&&-1!==JSON.stringify(t.parentNode.classList).indexOf("adnm-");)t=t.parentNode;return t}():i.play()}function h(e){const t=1-parseInt(d)/100;let n,i,o;if(!e)return!1;n=e.offsetHeight,i=e.offsetWidth,o=e.getBoundingClientRect();const r=function(){try{return window.top.document,!0}catch(e){return!1}}();return Math.floor(o.top)>=-n*t&&Math.floor(o.bottom)<=((r?window.top.innerHeight:window.innerHeight)||window.top.document.documentElement.clientHeight)+n*t&&Math.floor(o.left)>=-i*t&&Math.floor(o.right)<=((r?window.top.innerWidth:window.innerWidth)||window.top.document.documentElement.clientWidth)+i*t}function m(){i?.play&&o&&r100?.1:parseInt(n)/100,{setup:function(e,t){o=e;const n=t;if(n){new IntersectionObserver(s,{threshold:r}).observe(n)}}}},fe=5;const pe=function(e,t,n,i,o,r,s){const a=[],d=he;function c(e,t,i){(new re).addEventListener("viewableChange",(o=>{o?e?e.play():n.call("playVideo",{videoElementId:t},i):e?e.pause():n.call("pauseVideo",{videoElementId:t},i)})),e&&function(e,t){e.addEventListener("ended",(function(){t.currentLoops++,t.currentLoops{t.banner===r&&function(t,i,r){if(s&&re.IsMraidAvailable(s))c(null,t,r);else{const s=me(n,e,i,r);o.onSet("canvasMeasurable",(e=>{if(e){const n=e.viewablityElement;s.setup(t,n),a.push(s)}}))}}(t.elementId,t.percentage,i)})),{playIfInview:function(n,i,o){if(s&&re.IsMraidAvailable(s))c(n,"",null);else{const r=d(e,t,o);r.setup(n,i),a.push(r)}}}};const we=function(){let e=!1;const t={CUSTOM:1,BANNER_SCROLLED:2},n=new Map([[t.CUSTOM,"Custom event"],[t.BANNER_SCROLLED,"Banner scrolled event"]]);Object.freeze(t),Object.freeze(n);const i=new Map,o=new Map;function r(e){return!!Object.keys(t)&&Object.keys(t).filter((function(n){return t[n]===e})).length>0}function s(t,n){if(void 0===n&&(n=!1),e&&!n)throw"Could not remove listener, EventRelay is currently disconnecting all listeners.";if(!i.has(t))return;const r=i.get(t),s=o.get(r.eventType);s.has(t)&&s.delete(t),i.delete(t)}return{EventType:t,getEventTypeDescription:function(e){let i=null,o=Object.keys(t).filter((function(e){return isNaN(Number(e))})).sort((function(e,t){return e>t?1:e=0,s.isInView?i=s.scrollDistanceY/(s.bottom-s.top+r)*100:s.top>0?i=0:s.top<0&&(i=100),i},getScrolledPixed:function(t){return window.top.scrollY-t.offsetTop+e()},isInView:function(e){let t,n,i;return!!e&&(t=e.offsetHeight,n=e.offsetWidth,i=e.getBoundingClientRect(),Math.floor(i.top)>=.9*-t&&Math.floor(i.bottom)<=(window.top.innerHeight||window.top.document.documentElement.clientHeight)+.9*t&&Math.floor(i.left)>=.9*-n&&Math.floor(i.right)<=(window.top.innerWidth||window.top.document.documentElement.clientWidth)+.9*n)}}},ge=function(e,t,n,i,o){const r=1,s=we(),a=ve();let d=new Map,c=!1,l=!1;const u=e;let h=window.top;const m=[];function f(e,t){if(t){const n=t;if(o&&-1===o.findIndex((e=>e.contentWindow===n)))return;-1!==m.findIndex((e=>e.context===n))||m.push({context:n,name:e.banner})}}function p(e,t){const o=typeof e==typeof{}&&e.length>0&&void 0!==e[0].intersectionRect&&"number"==typeof e[0].intersectionRect.y;let r=0,d=a.isInView(t),c=0;if(o){e[0].boundingClientRect.y<0?(r=100,c=t.clientHeight):(r=0,c=0)}else(r=a.getScrollPercentage(t))>0&&r<100?(d=!0,c=a.getScrolledPixed(t)):(r=a.getScrollPercentage(t),c=a.getScrolledPixed(t));for(const e of m){const t={elementScrolledPercentage:r,elementScrolledPixels:c,isInView:d,pageScrolledPixels:window.top.scrollY,eventType:s.EventType.BANNER_SCROLLED,banner:n};e.context&&i.call("observeData",t,e.context)}s.raiseEvent(s.EventType.BANNER_SCROLLED,{elementScrolledPercentage:r,elementScrolledPixels:c,isInView:d,pageScrolledPixels:window.top.scrollY})}return function(e){false;i.subscribe("observeSubscribe",f);const t=function(t){!function(e,t){if(c)return;c=!0,p(e,t),setTimeout((function(){c=!1}),r)}(t,e)},n=document.querySelector("#adnm-iphone-screen");n&&"auto"===window.getComputedStyle(n).overflowY&&(h=n);h.addEventListener("scroll",t);let o=new IntersectionObserver((function(t){p(t,e)}));o.observe(e);const s=(new Date).getTime().toString();d.set(s,{observer:o,callback:t})}(u),{addListener:function(e){if(l)throw new Error("Could not add listener, scrollObserver is currently removing all listeners.");return s.addListener(s.EventType.BANNER_SCROLLED,e)},destroy:function(){l=!0,s.disconnectAll(),l=!1,i.unsubscribe("observeSubscribe",f),m.length=0}}},_e=["xbid-prod.googleusercontent.com/ddm/dbm/clicktracking/preview","googleusercontent.com/dv3c/clicktracking/preview","livepreview.adform.com","adspreview.google","preview.adnxs","creative-preview-an","creative-preview.mathads","gateway.app.nexta.io","adform.com/BannerTags/Views/Test","adform.com/line-items","advalidation.net","audit.adnxs.","easy-tag.appspot.com","preview-desk.thetradedesk.com","cr.adnxs.com","cq-reports.adnxs.net","ib.adnxs.com/cr?id","cmp.deltaprojects.com","sting.de17a.com","adsnap-prod.deltaprojects.net","adsnap-accept.deltaprojects.net","production.creative-serving.org","partner.googleadservices.com/gampad/ads","creative-preview.quantserve.com","adnun.net/adnami"];function be(e,t){return e.indexOf(t)>-1}const Ee=function(){for(var e=_e,t=document.referrer,n=window.location.host,i=window.location.href,o=0;o{void 0!==g[e]&&g[e]!==g.DEFAULT&&t(e)}),"renderMode")},set:function(t){g[t]&&e.set(g[t],"renderMode")},get:function(){return e.get("renderMode")}}};const Ie=function(e,t){const n=e,i=t;const o=function(){const e=parseInt(n),t=parseInt(i);return 1===e&&1===t||1===e&&2===t||1800===e&&1e3===t}();return{width:n,height:i,isExpandableSize:o}},Se=function(e){const t=e,n=window===window.top,i=Ee(),o=b(void 0),r=ye();return function(){const e=window.adnm?.renderMode===g.BANNER;i?r.set(g.IS_AUDIT):e&&r.set(g.BANNER)}(),{isWindowTop:n,isAudit:i,windowTopAccessible:o,getWindowTop:function(){if(o)return window.top;if(r.get()===g.IS_AUDIT)return window;throw new Error("Window.top can only be accessed by a canvas format")},getTagDimensions:function(){return Ie(t.width,t.height)},getRenderMode:r.get,onRenderModeChanged:r.onChanged,renderModes:g}};const Ae=function(e,t){let n=0;return()=>{Date.now()>=n+t&&(e(),n=Date.now())}},Ce=function(e,t,n,i){const o=[],r={};window.addEventListener("scroll",Ae((()=>{for(const e in r)r[e]()}),200));let s=null;function a(n,i,r,s){const a=n.contentWindow;if(r)a.postMessage({event:"adnm-sandbox-init",data:{sessionId:e.sessionId,placeholderName:t,content:i.documentElement.outerHTML,feedData:c(),customData:s}},"https://macro.adnami.io");else{if(a.document.open("text/html","replace"),a.__adnamiAdsAPI=window.__adnamiAdsAPI,s&&"object"==typeof s)for(const e in s)a[e]=s[e];a.document.write(i.documentElement.outerHTML),a.document.close()}o.push(n)}function d(){let t,n=null;try{n=function(t){const n=e.iframeWindow.document.querySelector(t);if(!n)throw Error(`Expected script tag with id '${t}' not found.`);const i=n.textContent;if(!i)throw Error("Script tag with feed data is empty. Expected JSON.");let o,r;try{o=JSON.parse(i)}catch(e){throw r=e instanceof Error?`Error parsing feed json: '${e}'`:`${e}`,Error(r)}if(!o.items)throw Error("Feed data does not contain expected property 'items'.");return o}("#adnm_proprietary_feed_data_json")}catch(e){t=e instanceof Error?e.message:`${e}`}return{feedData:n,errorMessage:t}}function c(){const t="#adnm_proprietary_feed_data_json";return e.iframeWindow.document.querySelector(t)?d():{feedData:null,errorMessage:`Expected script tag with id '${t}' not found.`}}return n.onSet("canvasMeasurable",(e=>{s=e?.viewablityElement})),{createDocument:function(e){return(new DOMParser).parseFromString(e,"text/html")},createIframe:function(n,d,c,l){const u=n.createElement("iframe");return u.setAttribute("data-adnm-channel",e.sessionId),u.setAttribute("id","adsm-iframe-"+t.toLowerCase()+"-"+e.sessionId),u.setAttribute("src",c?"https://macro.adnami.io/macro/gen/adnm.sandbox.html":"about:blank"),c&&u.setAttribute("data-adnm-sandbox",""),u.onload=()=>{if(-1!==o.indexOf(u))return;let e=2;"Mobile"===ee()&&(e=4),null===s||(M(s)??0)<=e*window.innerHeight?(a(u,d,c,l),i(ue.BANNER_INJECTED)):r[t]=()=>{(M(s)??0)<=e*window.innerHeight&&(a(u,d,c,l),delete r[t],i(ue.BANNER_INJECTED))}},u},getFeedDataResult:d}};const Oe=function(e){const t="https://functions.adnami.io/api/tracker?ev=error_"+e+"&cc=00000000-0000-0000-0000-000000000000&cs="+encodeURIComponent(window.location.href.replace(window.location.search,""))+"&_="+Date.now()+"&sid="+Date.now()+"&sit="+Date.now();if(navigator.sendBeacon)navigator.sendBeacon(t);else{(new window.Image).src=t}};function Te(e){const t=e.data.channelId,n=e.data.event;if(t&&n){const i=window.adnmEventCallbacks[t]?.[n]??[];for(const t of i)t(e.data.data,e.source);!0===e.data.forward&&"https://macro.adnami.io"===e.origin&&ke(e.data,window)}}function ke(e,t){const n=t.document.querySelectorAll(`iframe[data-adnm-sandbox][data-adnm-channel="${e.channelId}"]`);for(const t of n)t.contentWindow?.postMessage(e,"https://macro.adnami.io");const i=t.document.querySelectorAll("iframe[data-adnm-forward]");for(const t of i)t.contentWindow&&ke(e,t.contentWindow)}const Re=function(e){return void 0===window.adnmEventCallbacks&&(window.adnmEventCallbacks={}),{call:function(t,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.top,o=arguments.length>3?arguments[3]:void 0;i.postMessage({channelId:e,forward:o?.forward??!1,event:t,data:n},"*")},subscribe:function(t,n){0===Object.keys(window.adnmEventCallbacks).length&&window.addEventListener("message",Te),void 0===window.adnmEventCallbacks[e]&&(window.adnmEventCallbacks[e]={}),void 0===window.adnmEventCallbacks[e][String(t)]&&(window.adnmEventCallbacks[e][String(t)]=[]),window.adnmEventCallbacks[e][String(t)].push(n)},unsubscribe:function(t,n){const i=window.adnmEventCallbacks[e]?.[String(t)];if(!i)return;const o=i.indexOf(n);-1!==o&&(i.splice(o,1),0===i.length&&(delete window.adnmEventCallbacks[e][String(t)],0===Object.keys(window.adnmEventCallbacks[e]).length&&(delete window.adnmEventCallbacks[e],0===Object.keys(window.adnmEventCallbacks).length&&window.removeEventListener("message",Te))))},unsubscribeAll:function(){window.adnmEventCallbacks[e]&&(delete window.adnmEventCallbacks[e],0===Object.keys(window.adnmEventCallbacks).length&&window.removeEventListener("message",Te))},isSubscribed:function(t){return window.adnmEventCallbacks[e]?.[String(t)]?.length>0}}};const De=class{adStateMachine=new ie;onSet(e,t){const n=i=>{t(i),this.adStateMachine.removeCallback(e,n)};this.adStateMachine.onSet(e,n)}set(e,t){this.adStateMachine.set(e,!1,t)}};const xe=class{adEvents={destroy:"onDestroy",init:"onInit",loaded:"onLoaded"};canvasType="undefined";canvasTypeAllowed=!0;constructor(e,t){this.iframeContext=e,this.tracker=t}loaded(){this.canvasTypeAllowed?(this.exeCertEventFunc(this.adEvents.loaded),this.tracker.trackLoaded()):this.destroyFormat()}onDestroy(e){let t=!1;const n=this.iframeContext;n.addEventListener("unload",(n=>{t||(t=!0,this.exeCertEventFunc(this.adEvents.destroy),e(n))})),n.addEventListener("visibilitychange",(i=>{setTimeout((()=>{t||null!==n.frameElement||n===window.top||(t=!0,this.exeCertEventFunc(this.adEvents.destroy),e(i))}),0)}))}getCert(e){this.canvasType=e;const t=window.top?.adsm,n=t?.certifications?t?.certifications[this.canvasType]:void 0;if(!(!e||!t&&"object"!=typeof t||!n&&"object"!=typeof n))return null===n.cert&&this.tracker.trackError(ue.ERROR_GET_CERT),this.exeCertEventFunc(this.adEvents.init),this.setCanvasTypeAllowed(),n.cert}destroyFormat(){const e=this.iframeContext.frameElement?.parentNode;e?.classList.contains("adnm-creative")&&(e?.parentNode?.removeChild(e),this.tracker.trackEvent(ue.DESTROYED_FORMAT))}exeCertEventFunc(e){try{const t=window.top?.adsm?.certifications?.[this.canvasType]?.[e];t(this.iframeContext)}catch(e){}}setCanvasTypeAllowed(){const e=window.top?.adsm,t=e?.certifications?e?.certifications[this.canvasType]:void 0;"boolean"==typeof t.allowed?this.canvasTypeAllowed=t.allowed:this.canvasTypeAllowed=e?.certificationUnknownFormatTypeAllowed??this.canvasTypeAllowed}};const Le=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))};class Me{callbacks=[];subscribe(e){this.callbacks.push(e)}unsubscribe(e){const t=this.callbacks.indexOf(e);-1!==t&&this.callbacks.splice(t,1)}invoke(){for(const e of this.callbacks)e(...arguments)}dispose(){this.callbacks.length=0}}function Ne(e){const t=e.getAttribute("data-adnm-bridge-groups");return(t&&""!==t?t.split("|"):[]).map((e=>{const[t,n]=e.split("+");return{group:t,type:n}}))}class Pe{isObserving=!1;constructor(e){this.callback=e}observe(e){if(this.isObserving)throw new Error("EngagementObserver instance is already observing");this.isObserving=!0,e.addEventListener("click",(()=>{this.callback()})),this.observeDocumentIframes(e);let t=1;const n=setInterval((()=>{this.observeDocumentIframes(e),++t>=5&&clearInterval(n)}),500)}observeDocumentIframes(e){const t=e.querySelectorAll("iframe");for(const e of t)this.attachListenerToIframe(e)}attachListenerToIframe(e){const t=()=>{if(e.contentWindow&&e.contentDocument){e.contentWindow.removeEventListener("click",this.callback,!0),e.contentWindow.addEventListener("click",this.callback,!0);const t=e.contentWindow.document.querySelectorAll("iframe");for(const e of t)this.attachListenerToIframe(e)}};try{e.contentWindow?t():e.addEventListener("load",(()=>{t()}),!0)}catch(e){}}}class Be{id=Le();isDisposed=!1;onTrackerEventIntercepted=new Me;constructor(e){if(!window.top)throw new Error("Client instance does not have access to top window");if(this.server=window.top,this.options={...e},window.addEventListener("message",this.onMessageReceived.bind(this)),this.server.postMessage({type:"adnm-bridge-connect",clientId:this.id,clientType:this.options.type,clientGroup:this.options.group},"*"),this.options.element&&(function(e,t,n){const i=Ne(n);if(!i.some((t=>t.group===e))){i.push({group:e,type:t});const o=i.map((e=>`${e.group}+${e.type}`)).join("|");n.setAttribute("data-adnm-bridge-groups",o)}}(this.options.group,this.options.type,this.options.element),this.options.element)){const e=setInterval((()=>{this.options.element&&document.contains(this.options.element)||(clearInterval(e),this.isDisposed||this.dispose())}),1e4)}}dispose(){this.isDisposed||(window.removeEventListener("message",this.onMessageReceived.bind(this)),this.onTrackerEventIntercepted.dispose(),this.options.element&&function(e,t){const n=Ne(t).filter((t=>t.group!==e));if(n.length>0){const e=n.map((e=>`${e.group}+${e.type}`)).join("|");t.setAttribute("data-adnm-bridge-groups",e)}else t.removeAttribute("data-adnm-bridge-groups")}(this.options.group,this.options.element),this.isDisposed=!0)}trackEvent(e,t,n){this.server.postMessage({type:"adnm-bridge-track",clientId:this.id,event:e,time:t,details:n},"*")}createViewabilityObserver(e){let t=e.getBoundingClientRect();const n=ne(t.width,t.height),i=te(t.height,n,!1);new X((n=>{const i=Date.now();n===Y.ENTER_SCROLL?this.trackEvent("wrapper_inview",i):n===Y.EXIT_SCROLL?this.trackEvent("wrapper_leave_view",i,{time:0}):n===Y.ENTER_FOCUS?this.trackEvent("wrapper_page_inview",i):n===Y.EXIT_FOCUS?this.trackEvent("wrapper_page_leave_view",i,{time:0}):n===Y.VIEWED_SECOND&&(t=e.getBoundingClientRect(),this.trackEvent("wrapper_imp_viewed",i,{size:ne(t.width,t.height),device:Q.Banner,width:Math.round(t.width),height:Math.round(t.height),windowWidth:window.screen?.width??0,windowHeight:window.screen?.height??0}))}),{threshold:i}).observe(e)}createEngagementObserver(e){new Pe((()=>{const e=Date.now();this.trackEvent("click",e)})).observe(e)}interceptTrackerEvents(e){this.server.postMessage({type:"adnm-bridge-intercept",clientId:this.id,group:e},"*")}onMessageReceived(e){if(e.source!==this.server||!e.data)return;const t=e.data;t.clientId===this.id&&"adnm-bridge-event"===t.type&&t.event&&this.onTrackerEventIntercepted.invoke(t.event.name,t.event.time,t.event.details)}}const Ve=function(e,t){if(!0!==e?.valid)throw Oe(ue.ERROR_INVALID_API_CONFIG),new Error("AdnamiAdsAPI constructed with invalid apiConfig.");const n=new Be({group:e.sessionId,type:"native"}),i=new De,o=e.iframeWindow,r=Re(e.sessionId),s=le(e,t,i,r,n),a=new xe(o,s),d={tracker:s,videoController:pe(o,s.trackError,r,e.sessionId,i,t,e.sourceUrl),eventManager:r,environment:Se(e.tag),creativeConfigurator:Ce(e,t,i,s.trackEvent),onDestroy:function(e){a.onDestroy((t=>{e(t),d?.scrollObserver?.destroy(),d?.eventManager?.unsubscribeAll(),n.dispose()}))},getCert:function(t){if(!d.environment.windowTopAccessible)return;void 0===e.format&&(e.format=t);return a.getCert(t)},createScrollObserver:function(n,i){try{d.scrollObserver=ge(n,e.sessionId,t,r,i)}catch(e){}},loaded:function(){a.loaded()}};return{v1:d}};const We=function(e){if(void 0===e||void 0===e.valid||!1===e.valid)throw Oe(ue.ERROR_INVALID_API_CONFIG),new Error("AdnamiAdsAPIFactory constructed with invalid apiConfig.");var t=e,n=Ve;return{create:function(e){return n(t,e)},setCreativeCode:function(e){(function(e){return e&&"string"==typeof e&&36===e.length&&"00000000-0000-0000-0000-000000000000"!==e})(e)&&(t.creativeCode=e)}}},Ue=function(e,t,n,i,o){return{format:void 0,creativeCode:e,iframeWindow:t,sessionId:n,sessionTimeId:i,tag:o,formatType:arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",sourceUrl:arguments.length>6&&void 0!==arguments[6]?arguments[6]:void 0,clickUrl:arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,valid:!0}};(window.adsmtag=window.adsmtag||{}).rmb=window.adsmtag.rmb=window.adsmtag.rmb||{};const He={uuid:null,id:null,sit:null,adSource:null,ad:{width:1,height:1,click:"",flex:"",impressionSrc:"",custom:{}},scriptVersion:1,source:null,frame:null,placement:null};m("ADSM_RMB_ADS_INIT",(function(e,t){let n=JSON.parse(JSON.stringify(He));f.extend(n.ad,e.ad),n.uuid=e.uuid||"",n.id=e.id||"",n.sit=e.sit||"",n.scriptVersion=e.scriptVersion||1,n.source=t,n.adSource=e.adSource||"",n.sourceUrl=e.sourceUrl,n.formatType=e.formatType;const i=window.adsm||{};i.sessionIds=i.sessionIds||{},i.sessionIds[n.uuid]=n.id,i.sessionIdTimes=i.sessionIdTimes||{},i.sessionIdTimes[n.uuid]=n.sit,i.adSource=i.adSource||{},i.adSource[n.uuid]=n.adSource||"";const o=function(e){const t=document.querySelectorAll("iframe");for(let n=0;ne&&(o=e);r<0&&(r=0);r>e&&(r=e);return(r-o)/i*100>=50})()?(t.expanded||(rt.placement.style.paddingTop=rt.inread.ratioHeight+"%",rt.inread.expanded=!0),t.paused&&(t.paused=!1,e(n,{type:at}))):t.expanded&&!t.paused&&(t.paused=!0,e(n,{type:dt}))}function lt(e){r.tracker("format_unsupported",e.uuid||"")}m("ADSM_RMB_INREAD_INIT",(function(e,t){(rt=JSON.parse(JSON.stringify(st))).uuid=e.uuid||"",rt.source=t;var n=t;for(;n.parent&&n.parent!==window;)n=n.parent;for(var i=document.querySelectorAll("iframe"),o=0;o